home *** CD-ROM | disk | FTP | other *** search
- // Play Movie with Controller Sample
- // Based on QTShell
- // WWDC 2000
-
- #include "ComApplication.h"
- #include "ComFramework.h"
- #include "MacFramework.h"
-
- //////////
- //
- // HandleEditMenuItem
- // Perform the specified edit operation on the specified window.
- //
- //////////
-
- void HandleEditMenuItem (WindowReference theWindow, UInt16 theMenuItem)
- {
- WindowObject myWindowObject = NULL;
- MovieController myMC = NULL;
- Movie myEditMovie = NULL; // the movie created by some editing operations
-
- // give the application-specific code a chance to intercept the menu item selection
- if (QTApp_HandleMenu(theMenuItem))
- return;
-
- myWindowObject = QTFrame_GetWindowObjectFromWindow(theWindow);
- myMC = QTFrame_GetMCFromWindow(theWindow);
-
- // make sure we have a valid movie controller and a valid window object
- if ((myMC == NULL) || (myWindowObject == NULL))
- return;
-
- switch (theMenuItem) {
-
- // Step 1. Insert SwitchEdit.clp here...
-
- default:
- break;
- } // switch (theMenuItem)
-
- // place any cut or copied movie segment onto the scrap
- if (myEditMovie != NULL) {
- PutMovieOnScrap(myEditMovie, 0L);
- DisposeMovie(myEditMovie);
- }
- }
-
- //////////
- //
- // SelectAllMovie
- // Select the entire movie associated with the specified movie controller.
- //
- //////////
-
- OSErr SelectAllMovie (MovieController theMC)
- {
- TimeRecord myTimeRecord;
- Movie myMovie = NULL;
- ComponentResult myErr = noErr;
-
- if (theMC == NULL)
- return(paramErr);
-
- myMovie = MCGetMovie(theMC);
- if (myMovie == NULL)
- return(paramErr);
-
- // Step 2. Insert SelectAll.clp here...
-
- return((OSErr)myErr);
- }
-
-
- //////////
- //
- // SelectNoneMovie
- // Select none of the movie associated with the specified movie controller.
- //
- //////////
-
- OSErr SelectNoneMovie (MovieController theMC)
- {
- TimeRecord myTimeRecord;
- Movie myMovie = NULL;
- ComponentResult myErr = noErr;
-
- if (theMC == NULL)
- return(paramErr);
-
- myMovie = MCGetMovie(theMC);
- if (myMovie == NULL)
- return(paramErr);
-
- // Step 3. Insert SelectNone.clp here...
-
- return((OSErr)myErr);
- }
-